<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>view事件监听v-on</title>
</head>
<body>
    <div id="app">
      <!-- MouseEvent {isTrusted: true, screenX: 428, screenY: 147, clientX: 32, clientY: 23, …} -->
      <!-- 如果在事件定义时, 写函数时省略了小括号, 但是方法本身是需要一个参数的, 这个时候Vue会默认传递event -->
      <button @click="add">点击</button>
    </div>
  
    <script src="../js/vue.js"></script>
    <script>
      const app = new Vue({
        el: "#app",
        data: {},
        methods: {
          add(event) {
            console.log(event);
          }
        }
      })
    </script>
  </body>
  
  
</html>